package com.zufe.test3;

import java.util.Scanner;

public class CarTest {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        Car[] cars = new Car[3];
        for (int i = 0; i < cars.length; i++) {
            System.out.println("Please enter the brand of the car:");
            String brand = sc.next();
            System.out.println("Please enter the price of the car:");
            int price = sc.nextInt();
            System.out.println("Please enter the color of the car:");
            String color = sc.next();
            cars[i] = new Car(brand, price, color);
        }
        for (Car car : cars) {
            System.out.println("Brand: " + car.getBrand() + ", Price: " + car.getPrice() + ", Color: " + car.getColor());
        }
    }
}
